using System;
using System.Collections.Generic;
using System.Text;
using System.Data.OleDb;
using DTO;
using System.Data;
using HeThongDAO;

namespace HeThongBUS
{
    public enum PhanLoaiTaiKhoanBUSResult
    {
        OK,
        USERNAMEERROR,
        PASSWORDERROR,
        DAOERROR
    }

    public class PhanLoaiTaiKhoanBUS
    {
        public static DataTable LayDanhSachLoaiTaiKhoan()
        {
            return PhanLoaiTaiKhoanDAO.LayDanhSachLoaiTaiKhoan();
        }

        public static PhanLoaiTaiKhoanBUSResult ThemLoaiTaiKhoan(PhanLoaiTaiKhoanDTO loaiTKDTO)
        {
            // Kiem tra du lieu nhap


            if (!PhanLoaiTaiKhoanDAO.ThemLoaiTaiKhoan(loaiTKDTO))
                return PhanLoaiTaiKhoanBUSResult.DAOERROR;
            return PhanLoaiTaiKhoanBUSResult.OK;
        }

        public static PhanLoaiTaiKhoanBUSResult CapNhatLoaiTaiKhoan(PhanLoaiTaiKhoanDTO loaiTKDTO)
        {
            // Kiem tra du lieu nhap


            if (!PhanLoaiTaiKhoanDAO.CapNhatLoaiTaiKhoan(loaiTKDTO))
                return PhanLoaiTaiKhoanBUSResult.DAOERROR;
            return PhanLoaiTaiKhoanBUSResult.OK;
        }

        public static PhanLoaiTaiKhoanBUSResult XoaLoaiTaiKhoan(PhanLoaiTaiKhoanDTO loaiTKDTO)
        {
            // Kiem tra du lieu nhap


            if (!PhanLoaiTaiKhoanDAO.XoaLoaiTaiKhoan(loaiTKDTO))
                return PhanLoaiTaiKhoanBUSResult.DAOERROR;
            return PhanLoaiTaiKhoanBUSResult.OK;
        }
    }
}

